<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        /*变量不声明 var 直接赋值表示全局变量*/

        fun();
        a=9;
        console.log(typeof a)
        console.log(a);
        console.log(b);
        console.log(c);
        console.log(d);

        function fun(){

            //等价于 var a=10 ; b=10; c=10; d=10;     bcd变成全局变量
            // 集体声明应该这样  var a=10, b=10,c=10;
         var a=b=c=d=10;

            console.log(a);
            console.log(b);
            console.log(c);
            console.log(d);
        }
    </script>
</head>
<body>

</body>
</html>